package lib.self.adapter.recycler;

import android.view.View;

import lib.self.bean.TreeBean;
import lib.self.bean.TreeChildBean;

/**
 * description:RecyclerAdapter 用于二级列表--子item统一的情况下使用
 * author: Steven Xiao
 * date 2018/10/29
 */
public abstract class TreeRecyclerAdapterEx<T extends TreeBean<C>, C extends TreeChildBean, VH extends RecyclerViewHolderEx>
        extends MultiTreeRecyclerAdapterEx<T, C, VH> {

    private final int KTypeChild = 0x1000002;//子条目

    @Override
    public final int getItemViewChildType(int parentPosition, int childPosition) {
        return getItemViewChildType();
    }

    public final int getItemViewChildType() {
        return KTypeChild;
    }

    @Override
    public final int getConvertChildViewResId(int itemType) {
        return getConvertChildViewResId();
    }

    public abstract int getConvertChildViewResId();

    @Override
    protected final VH initViewHolder(View view, int itemType) {
        return initViewHolder(view);
    }

    public abstract VH initViewHolder(View view);
}
